import request from '@/utils/request'

// 查询样品列表
export function listSample(query) {
    return request({
        url: '/sample/list',
        method: 'get',
        params: query
    })
}
//确认样品
export function Cconfirm(id){
    return request({
        url:'/sample/c?id='+id,
        method:'get'
    })
}

// 查询样品详细
export function getSample(sampleId) {
    return request({
        url: '/sample/' + sampleId,
        method: 'get'
    })
}
export function checkSampleName(pid,name){
    return request({
        url: '/sample/name?projectId=' + pid+'&name='+name,
        method: 'get'
    })
}

// 新增样品
export function addSample(data) {
    return request({
        url: '/sample',
        method: 'post',
        data: data
    })
}
//批量导入样品
export function importSamples(data) {
    return request({
        url: '/sample/import',
        method: 'post',
        data: data
    })
}

// 修改样品
export function updateSample(data) {
    return request({
        url: '/sample',
        method: 'put',
        data: data
    })
}

// 删除样品
export function delSample(sampleId) {
    return request({
        url: '/sample/' + sampleId,
        method: 'delete'
    })
}

export function listItem(query){
    return request({
        url:'/sample/item',
        method:'get',
        params: query
    })
}
//流转样品
export function postFlume(data){
    return request({
        url:'/sample/flume',
        method:'post',
        data:data
    })
}
//退回样品
export function postFlumeBack(data){
    return request({
        url:'/sample/flumeback',
        method:'post',
        data:data
    })
}

export function listStatus(sampleIds){
    return request({
        url: '/sample/status/' + sampleIds,
        method: 'get'
    })
}
//流转信息
export function listLz(sampleId){
    return request({
        url:'/sample/lz?id='+sampleId,
        method:'get'
    })
}
